// 商品准入-未提交
import { PRODUCT_TYPE_OPTIONS } from '@/constants/commodity';
import { getAuthDepartmentsFn } from '@/pages/commodity/modules/utils/salePriceRequireUtils';
const FORM_ITEM_LIST = [
  {
    prop: 'productNameFinal',
    label: '商品名称',
    type: 'input'
  },
  {
    prop: 'categoryPath',
    label: '分类',
    type: 'input',
  },
  {
    prop: 'spuNo',
    label: 'SPU编码',
    type: 'input',
    searchType: 'EQ'
  },
  {
    prop: 'productType',
    label: '商品类型',
    type: 'select',
    clearable: true,
    options: PRODUCT_TYPE_OPTIONS,
  },
  {
    prop: 'brandName',
    label: '商品品牌',
    type: 'input',
  },
  {
    prop: 'createOper',
    label: '创建人',
    type: 'userSelect',
    searchType: 'EQ'
  }
]
const initTableColumns = (parent) => {
  return [
    {
      title: '分类',
      key: 'categoryPath'
    },
    {
      title: 'SPU编码',
      key: 'spuNo'
    },
    {
      title: '商品名称',
      key: 'productName'
    },
    {
      title: '品牌',
      key: 'brandName'
    },
    {
      title: '创建人',
      key: 'createOperName'
    },
    {
      title: '创建人部门',
      key: 'createOperDeptName'
    },
    {
      title: '商品类型',
      key: 'productTypeStr'
    },
    {
      title: '归属部门',
      slot: 'authDepartments',
      minWidth: 150,
      align: 'center',
      render: (h, { row }) => {
        return h('div', getAuthDepartmentsFn(row));
      }
    },
    {
      title: '管理区域',
      key: 'manageArea'
    },
    {
      title: '销售属性',
      key: 'saleAttrInfo'
    },
    {
      title: '创建日期',
      key: 'createOpeTime'
    },
  ]
}
export {
  FORM_ITEM_LIST,
  initTableColumns
}
